﻿using Core.CSV;

namespace Game {
    public class WeaponEffectFactory {
        public static WeaponEffect New(uint id) {
            TBWeaponEffectConfig config = Tables.TBWeaponEffect.GetRow<TBWeaponEffectConfig>(id);

            return New(config);
        }

        public static WeaponEffect New(TBWeaponEffectConfig config) {
            switch (config.ID) {
                case WeaponEffectID.DOUBLE_DAMAGE:
                    return new DoubleDamageEffect(config);
                case WeaponEffectID.DOUBLE_SPAWN:
                    return new DoubleSpawnEffect(config);
                case WeaponEffectID.DOUBLE_SPEED:
                    return new DoubleSpeedEffect(config);
                case WeaponEffectID.BULLET_SPAWNER:
                    return new BulletSpawnerEffect(config);
                case WeaponEffectID.DOUBLE_SPAWN_FOR_NEXT:
                    return new DoubleSpawnForNextEffect(config);
            }

            return null;
        }
    }
}